package com.ruoyi.netty.utils;

import com.alibaba.fastjson.JSON;
import com.ruoyi.netty.domain.MsgAgreement;

/**
 * 构建消息
 *
 * @author zhoujun
 */
public class MsgUtil {

    public static MsgAgreement json2Obj(String objJsonStr) {
        objJsonStr = objJsonStr.replace("\r\n", "");
        return JSON.parseObject(objJsonStr, MsgAgreement.class);
    }

    public static String obj2Json(MsgAgreement msgAgreement) {
        return JSON.toJSONString(msgAgreement) + "\r\n";
    }

}
